package cn.signalpha.modules.com.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 数据传输对象实体类
 *
 * @author signalpha
 */
@Data
@ApiModel(value = "UserDTO对象", description = "后台用户DTO")
public class UserDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;
	@ApiModelProperty(value = "邀请码")
	private String account;
	@ApiModelProperty(value = "手机")
	private String mobile;
    @ApiModelProperty(value = "昵称")
    private String nickName;
    @ApiModelProperty(value = "头像")
    private String avatar;
	@ApiModelProperty(value = "等级")
	private Integer level;
	@ApiModelProperty(value = "标签id")
	private String tagId;
	@ApiModelProperty(value = "备注")
	private String remark;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

	@Data
	public static class UpdateMobileDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		private Long id;
		@NotBlank
		@ApiModelProperty(value = "手机号")
		private String mobile;
		@ApiModelProperty(value = "短信验证码 公众号端传入")
		private String smsCode;
	}

	@Data
	public static class UpdateStatusDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotNull
		@ApiModelProperty(value = "id")
		private Long id;
		@NotNull
		@ApiModelProperty(value = "状态")
		private Integer status;
	}

	@Data
	public static class UpdatePidDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotNull
		@ApiModelProperty(value = "id")
		private Long id;
		@NotNull
		@ApiModelProperty(value = "目标id")
		private Long parentId;
	}

	@Data
	public static class UpdateTagDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotBlank
		@ApiModelProperty(value = "id")
		private String id;
		@NotBlank
		@ApiModelProperty(value = "目标id")
		private String tagId;
	}

	@Data
	public static class UpdateBaseDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		private Long id;
		@ApiModelProperty(value = "昵称")
		private String nickName;
		@ApiModelProperty(value = "头像")
		private String avatar;
		@ApiModelProperty(value = "性别：0未知 1男 2女")
		private Integer sex;
		@DateTimeFormat(pattern ="yyyy-MM-dd")
		@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
		@ApiModelProperty(value = "生日")
		private Date birthday;
		@ApiModelProperty(value = "标签id")
		private String tagId;
	}

	@Data
	public static class UpdatePwdDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotBlank
		@ApiModelProperty(value = "新密码")
		private String password;
		@NotBlank
		@ApiModelProperty(value = "短信验证码")
		private String smsCode;
		@NotBlank
		@ApiModelProperty(value = "手机号")
		private String mobile;
	}

}
